<?php

class Application_Model_Orderdetail extends Zend_Db_Table_Abstract
{
    protected $_name = 'order_detail';
    protected $_primary = array('product_id', 'order_id');
    
    public function Get_Order_Detail_with_OrderID($order_id){
        try{
            $select = $this->select()
                           ->setIntegrityCheck(false)
                           ->from($this->_name)
                           ->join('product', 'product.product_id = order_detail.product_id')
                           ->where('order_detail.order_id = ?', $order_id)
                           ->order('product_name ASC');
            return $this->fetchAll($select);
        }
        catch (Zend_Exception $ex){
            echo $ex;
        }
    }
}

